/* $Header: pneu_tbls.c,v 2.2 01/10/02 10:29:21 przybyls Exp $ */

/* pneu_tbls.c - workfile get/set for pneu setpoints */
/* wikfors; sometime in late 1992 */
/* Copyright (c) 1992, Hewlett-Packard Co. */

#include <typedefs.h>
#include <pcb_defs.h>
#include <error.h>
#include <p_wkfile.h>
#include <p_status.h>
#include <wkfile.h>
#include <ramps.h>
#include <zone_config.h>
#include <zone_status.h>
#include <status.h>
#include <zone_ui.h>
#include <method.h>
#include <p_ui.h>
#include <i_op.h>
#include <meth_config.h>
#include <exception.h>
#include <err_handler.h>
#include <clock_ui.h>


#define METH_RATE     METH_INT2
#define METH_PRES     METH_INT0
#define METH_FLOW     METH_INT0
#define METH_TIME     METH_INT2
#define METH_NUM      METH_INT0
#define METH_TEMP     METH_INT0
#define METH_ZONE_ERR METH_INT0




/* function prototypes */
UI_ERR NullFunc(void *which);

void TurnInterruptsON ( void );
void TurnInterruptsOFF ( void );

UI_ERR DummyFunc        ( void *which );
UI_ERR LockPneuWkfile   ( void *which );
UI_ERR IFLockPneuWkfile ( void *which );
UI_ERR IBLockPneuWkfile ( void *which );

UI_ERR IFSPLockPneuWkfile ( void *which );
UI_ERR IBSPLockPneuWkfile ( void *which );
UI_ERR IFGVLockPneuWkfile ( void *which );
UI_ERR IBGVLockPneuWkfile ( void *which );
UI_ERR IFGPLockPneuWkfile ( void *which );
UI_ERR IBGPLockPneuWkfile ( void *which );
UI_ERR IFMSLockPneuWkfile ( void *which );
UI_ERR IBMSLockPneuWkfile ( void *which );
UI_ERR IFCPLockPneuWkfile ( void *which );
UI_ERR IBCPLockPneuWkfile ( void *which );
UI_ERR IFPPLockPneuWkfile ( void *which );
UI_ERR IBPPLockPneuWkfile ( void *which );
UI_ERR IFDPLockPneuWkfile ( void *which );
UI_ERR IBDPLockPneuWkfile ( void *which );
UI_ERR IFVILockPneuWkfile ( void *which );
UI_ERR IBVILockPneuWkfile ( void *which );

UI_ERR UnlockPneuWkfile ( void *which );

static INT32  mGetInletHasColumn  ( void *status, U_INT8 unused_parm );
static INT32  mGetInletMode       ( void *status, U_INT8 unused_parm );
static INT32  mGetTempStatus      ( void *status, U_INT8 unused_parm );
static INT32  mGetTempSetpt       ( void *status, U_INT8 unused_parm );
static INT32  mGetTempActual      ( void *status, U_INT8 unused_parm );
static INT32  mGetInletPres       ( void *status, U_INT8 unused_parm );
static INT32  mGetInletWkfileState( void *status, U_INT8 unused_parm );
static INT32  mGetInletPresActual ( void *status, U_INT8 unused_parm );
static INT32  mGetInletPurgeFlow  ( void *status, U_INT8 unused_parm );
static INT32  mGetInletPurgeTime  ( void *status, U_INT8 unused_parm );
static INT32  mGetInletTotalFlow  ( void *status, U_INT8 unused_parm );
static INT32  mGetInletFlowActual ( void *status, U_INT8 unused_parm );
static INT32  mGetInletSplitRatio ( void *status, U_INT8 unused_parm );
#if 0
static INT32  mGetInletSplitFlow  ( void *status, U_INT8 unused_parm );
#endif
static INT32  mGetInletPulsePres  ( void *status, U_INT8 unused_parm );
static INT32  mGetInletPulseTime  ( void *status, U_INT8 unused_parm );
static INT32  mGetInletVentPres   ( void *status, U_INT8 unused_parm );
static INT32  mGetInletVentFlow   ( void *status, U_INT8 unused_parm );
static INT32  mGetInletVentTime   ( void *status, U_INT8 unused_parm );
static INT32  mGetInletMiserFlow  ( void *status, U_INT8 unused_parm );
static INT32  mGetInletMiserTime  ( void *status, U_INT8 unused_parm );
static INT32  mGetInletMiserState ( void *status, U_INT8 unused_parm );
static INT32  mGetInletSmplgTime  ( void *status, U_INT8 unused_parm );
static INT32  mGetInletStatus     ( void *status, U_INT8 unused_parm );
static INT32  mGetInletGasType    ( void *status, U_INT8 unused_parm );
static INT32  mGetInletType       ( void *status, U_INT8 unused_parm );
static INT32  mGetInletPresEquib  ( void *status, U_INT8 unused_parm );
static INT32  mGetInletFlowEquib  ( void *status, U_INT8 unused_parm );
static INT32  mGetInletTempComp   ( void *status, U_INT8 unused_parm );
static INT32  mGetInletAmbTemp    ( void *status, U_INT8 unused_parm );
static INT32  mGetInletFlowDVolts ( void *status, U_INT8 unused_parm );
static INT32  mGetInletPresDVolts ( void *status, U_INT8 unused_parm );
static INT32  mGetPackedInletParm ( void *status, U_INT8 unused_parm );
static INT32  mGetSprParm1        ( void *status, U_INT8 unused_parm );
static INT32  mGetSprParm2        ( void *status, U_INT8 unused_parm );
static INT32  mGetZonePresence    ( void *status, U_INT8 unused_parm );
static INT32  mGetInletPneuCfg    ( void *status, U_INT8 unused_parm );
static INT32  mGetInletPSensorRange( void *status, U_INT8 unused_parm );

static INT32  mGetInletCalPres    ( void *status, U_INT8 unused_parm );
static INT32  mGetInletCalFlow    ( void *status, U_INT8 unused_parm );
static INT32  mGetInletCalState   ( void *status, U_INT8 unused_parm );
static INT32  mGetInletCalDate    ( void *status, U_INT8 unused_parm );
static INT32  mGetInletCalPresZero( void *status, U_INT8 unused_parm );
static INT32  mGetInletCalFlowZero( void *status, U_INT8 unused_parm );
static INT32  mGetInletCalPresGain( void *status, U_INT8 unused_parm );
static INT32  mGetInletCalFlowGain( void *status, U_INT8 unused_parm );
static INT32  mGetInletCalZeroState(void *status, U_INT8 unused_parm );
static INT32  mGetInletAutoCal     (void *status, U_INT8 unused_parm );
static INT32  mGetCPFInletTitle    (void *status, U_INT8 unused_parm );



static UI_ERR mTestInletHasColumn ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mSetInletMode       ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mSetInletPres       ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mSetInletPresNow    ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mSetInletState      ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mSetInletPurgeFlow  ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mSetInletPurgeTime  ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mSetInletTotalFlow  ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mSetInletFlowNow    ( void *status, INT32 setpt, U_INT8 unused_parm );
#if 0
static UI_ERR mSetInletSplitFlowNow(void *status, INT32 setpt, U_INT8 unused_parm );
#endif
static UI_ERR mSetInletSplitRatio ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mSetInletPulsePres  ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mSetInletPulseTime  ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mSetInletVentFlow   ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mSetInletVentPres   ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mSetInletVentTime   ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mSetInletMiserFlow  ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mSetInletMiserTime  ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mSetInletMiserState ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mSetInletSmplgTime  ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mSetInletGasType    ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mSetInletType       ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mSetInletPresEquib  ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mSetInletFlowEquib  ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mSetInletTempComp   ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mSetPackedInletParm ( void *status, INT32 setpt, U_INT8 unused_parm );

static UI_ERR mSetInletCalPres    ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mSetInletCalFlow    ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mSetInletCalPresZero( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mSetInletCalFlowZero( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mSetInletCalState   ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mSetInletAutoCal    ( void *status, INT32 setpt, U_INT8 unused_parm );

static UI_ERR mSetInletFactoryCalPresZero( void *status, INT32 setpt, U_INT8 unused_parm );


static UI_ERR mLetInletType       ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mLetZonePresence    ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mLetInletPneuCfg     ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mLetInletPSensorRange( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mLetInletGasType    ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mLetInletPresEquib  ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mLetInletFlowEquib  ( void *status, INT32 setpt, U_INT8 unused_parm );

typedef INT32  (* const GET)(void *status, U_INT8 unused_parm);
typedef UI_ERR (* const SET)(void *status, INT32 setpt, U_INT8 unused_parm);

typedef struct
{
      void * const pneu;
      void * const zone;
} MULTIPLE_PTRS;


#define pneu_status  ((MULTIPLE_PTRS * const)status)->pneu
#define zone_status  ((MULTIPLE_PTRS * const)status)->zone

/*
typedef struct
{
        INT32 (* const getFunction)(void *which, U_INT8 ramp_number);
        UI_ERR (* const setFunction)(void *which, INT32 setpt, U_INT8 ramp_number);
        const U_INT8 selector;
        const METHFORMAT format;
}
METHCMD_ENTRY;

"method.h" [Read only] line 58 of 117 --49%--

*/

typedef INT32  (* const pGET) ( void *status, U_INT8 parm_num );
typedef UI_ERR (* const pSET) ( void *status, INT32 setpt, U_INT8 parm_num );

static  U_INT8        answer;

INT32  NullGet ( void *status, U_INT8 parm_num )
{
    (void) status;
    (void) parm_num;

    return 0;
}

UI_ERR NullSet ( void *status, INT32 setpt, U_INT8 parm_num )
{
     (void) status;
     (void) setpt;
     (void) parm_num;

     return OK;
}


typedef struct {

            pGET  Get;
            pSET  Set;

               }  *pFUNC_TABLE_ENTRY, FUNC_TABLE_ENTRY;




   /* Inject_Mode is always the first parameter, this way any of the */
   /* flavors of this command will set it and point the rest of the  */
   /* parameters to the proper flavor (on a set).  On a Get, using   */
   /* the real inject mode will direct us to the proper flavor.      */
   /*                                                                */
   /* In all cases, (get & set) the column configuration must be sent*/
   /* first or the we will not get valid results.                    */



/*
#if SPLIT !=0 || SPLITLESS !=1 || SPLITLESS_PULSED !=2 || SPLIT_PULSED !=3 || SOLVENT_VENT !=4 || avail1 !=5 || DIRECT !=6
  Force_An_Error b/c need modes as shown above
#endif
*/

            /* split splitless pulsed_splitless pulsed_split */ /* col, no col */ /* parm num */
static const FUNC_TABLE_ENTRY SS_Cmd_Table[ 4 ][ 2 ][ 10 ] =

   {{{{ mGetInletHasColumn,   mTestInletHasColumn  },  /* split, no column */
      { mGetInletMode,        mSetInletMode        },
      { mGetInletPres,        mSetInletPres        },
      { mGetInletTotalFlow,   mSetInletTotalFlow   },
      { (pGET)NullGet,        (pSET)NullSet        },
      { (pGET)NullGet,        (pSET)NullSet        },
      { (pGET)NullGet,        (pSET)NullSet        },
      { mGetInletMiserFlow,   (pSET)NullSet        },
      { mGetInletMiserTime,   (pSET)NullSet        },
      { (pGET)NullGet,        (pSET)NullSet        }},

     {{ mGetInletHasColumn,   mTestInletHasColumn  },
      { mGetInletMode,        mSetInletMode        }, /* split, has column */
      { mGetInletPres,        mSetInletPres        },
      { mGetInletSplitRatio,  mSetInletSplitRatio  },
      { (pGET)NullGet,        (pSET)NullSet        },
      { (pGET)NullGet,        (pSET)NullSet        },
      { (pGET)NullGet,        (pSET)NullSet        },
      { mGetInletMiserFlow,   mSetInletMiserFlow   },
      { mGetInletMiserTime,   mSetInletMiserTime   },
      { mGetInletMiserState,  mSetInletMiserState  }}},

    {{{ mGetInletHasColumn,   mTestInletHasColumn  },
      { mGetInletMode,        mSetInletMode        }, /* splitless, no column */
      { mGetInletPres,        mSetInletPres        },
      { mGetInletTotalFlow,   mSetInletTotalFlow   },
      { mGetInletPurgeTime,   mSetInletPurgeTime   },
      { (pGET)NullGet,        (pSET)NullSet        },
      { (pGET)NullGet,        (pSET)NullSet        },
      { mGetInletMiserFlow,   (pSET)NullSet        },
      { mGetInletMiserTime,   (pSET)NullSet        },
      { (pGET)NullGet,        (pSET)NullSet        }},

     {{ mGetInletHasColumn,   mTestInletHasColumn  },
      { mGetInletMode,        mSetInletMode        }, /* splitless, has column */
      { mGetInletPres,        mSetInletPres        },
      { mGetInletPurgeFlow,   mSetInletPurgeFlow   },
      { mGetInletPurgeTime,   mSetInletPurgeTime   },
      { (pGET)NullGet,        (pSET)NullSet        },
      { (pGET)NullGet,        (pSET)NullSet        },
      { mGetInletMiserFlow,   mSetInletMiserFlow   },
      { mGetInletMiserTime,   mSetInletMiserTime   },
      { mGetInletMiserState,  mSetInletMiserState  }}},


    {{{ mGetInletHasColumn,   mTestInletHasColumn  },
      { mGetInletMode,        mSetInletMode        }, /* pulsed, no column */
      { mGetInletPres,        mSetInletPres        },
      { mGetInletTotalFlow,   mSetInletTotalFlow   },
      { mGetInletPurgeTime,   mSetInletPurgeTime   },
      { mGetInletPulsePres,   mSetInletPulsePres   },
      { mGetInletPulseTime,   mSetInletPulseTime   },
      { mGetInletMiserFlow,   (pSET)NullSet        },
      { mGetInletMiserTime,   (pSET)NullSet        },
      { (pGET)NullGet,        (pSET)NullSet        }},

     {{ mGetInletHasColumn,   mTestInletHasColumn  },
      { mGetInletMode,        mSetInletMode        }, /* pulsed, has column */
      { mGetInletPres,        mSetInletPres        },
      { mGetInletPurgeFlow,   mSetInletPurgeFlow   },
      { mGetInletPurgeTime,   mSetInletPurgeTime   },
      { mGetInletPulsePres,   mSetInletPulsePres   },
      { mGetInletPulseTime,   mSetInletPulseTime   },
      { mGetInletMiserFlow,   mSetInletMiserFlow   },
      { mGetInletMiserTime,   mSetInletMiserTime   },
      { mGetInletMiserState,  mSetInletMiserState  }}},

    {{{ mGetInletHasColumn,   mTestInletHasColumn  },  /* pulsed split, no column */
      { mGetInletMode,        mSetInletMode        },
      { mGetInletPres,        mSetInletPres        },
      { mGetInletTotalFlow,   mSetInletTotalFlow   },
      { (pGET)NullGet,        (pSET)NullSet        },
      { mGetInletPulsePres,   mSetInletPulsePres   },
      { mGetInletPulseTime,   mSetInletPulseTime   },
      { mGetInletMiserFlow,   (pSET)NullSet        },
      { mGetInletMiserTime,   (pSET)NullSet        },
      { (pGET)NullGet,        (pSET)NullSet        }},

     {{ mGetInletHasColumn,   mTestInletHasColumn  },
      { mGetInletMode,        mSetInletMode        }, /* pulsed split, has column */
      { mGetInletPres,        mSetInletPres        },
      { mGetInletSplitRatio,  mSetInletSplitRatio  },
      { (pGET)NullGet,        (pSET)NullSet        },
      { mGetInletPulsePres,   mSetInletPulsePres   },
      { mGetInletPulseTime,   mSetInletPulseTime   },
      { mGetInletMiserFlow,   mSetInletMiserFlow   },
      { mGetInletMiserTime,   mSetInletMiserTime   },
      { mGetInletMiserState,  mSetInletMiserState  }}}};




static INT32  mGetSsInletParm       ( void *status, U_INT8 parm_num )
{
        return (INT32)  SS_Cmd_Table [ (U_INT8) (((pINLET_STATUS)pneu_status)->Wkfile->Injection_Mode) ]
                                     [ (U_INT8) (((pINLET_STATUS)pneu_status)->Has_Column) ]
                                     [ parm_num ].Get     ( status, parm_num );
}


static UI_ERR mSetSsInletParm       ( void *status, INT32 setpt, U_INT8 parm_num )
{
        return  SS_Cmd_Table  [ (U_INT8) (((pINLET_STATUS)pneu_status)->Wkfile->Injection_Mode) ]
                              [ (U_INT8) (((pINLET_STATUS)pneu_status)->Has_Column) ]
                              [ parm_num ].Set     ( status, setpt, parm_num );
}





   /* Inject_Mode is always the first parameter, this way any of the */
   /* flavors of this command will set it and point the rest of the  */
   /* parameters to the proper flavor (on a set).  On a Get, using   */
   /* the real inject mode will direct us to the proper flavor.      */
   /*                                                                */
   /* In all cases, (get & set) the column configuration must be sent*/
   /* first or the we will not get valid results.                    */


            /* split splitless pulsed_splitless pulsed_split */ /* col, no col */ /* parm num */
static const FUNC_TABLE_ENTRY GPTV_Cmd_Table[ 5 ][ 2 ][ 11 ] =

   {{{{ mGetInletHasColumn,   mTestInletHasColumn  },  /* split, no column */
      { mGetInletMode,        mSetInletMode        },
      { mGetInletPres,        mSetInletPres        },
      { mGetInletTotalFlow,   mSetInletTotalFlow   },
      { (pGET)NullGet,        (pSET)NullSet        },
      { (pGET)NullGet,        (pSET)NullSet        },
      { (pGET)NullGet,        (pSET)NullSet        },
      { (pGET)NullGet,        (pSET)NullSet        },
      { mGetInletMiserFlow,   (pSET)NullSet        },
      { mGetInletMiserTime,   (pSET)NullSet        },
      { (pGET)NullGet,        (pSET)NullSet        }},

     {{ mGetInletHasColumn,   mTestInletHasColumn  },
      { mGetInletMode,        mSetInletMode        }, /* split, has column */
      { mGetInletPres,        mSetInletPres        },
      { mGetInletSplitRatio,  mSetInletSplitRatio  },
      { (pGET)NullGet,        (pSET)NullSet        },
      { (pGET)NullGet,        (pSET)NullSet        },
      { (pGET)NullGet,        (pSET)NullSet        },
      { (pGET)NullGet,        (pSET)NullSet        },
      { mGetInletMiserFlow,   mSetInletMiserFlow   },
      { mGetInletMiserTime,   mSetInletMiserTime   },
      { mGetInletMiserState,  mSetInletMiserState  }}},

    {{{ mGetInletHasColumn,   mTestInletHasColumn  },
      { mGetInletMode,        mSetInletMode        }, /* splitless, no column */
      { mGetInletPres,        mSetInletPres        },
      { mGetInletTotalFlow,   mSetInletTotalFlow   },
      { mGetInletPurgeTime,   mSetInletPurgeTime   },
      { (pGET)NullGet,        (pSET)NullSet        },
      { (pGET)NullGet,        (pSET)NullSet        },
      { (pGET)NullGet,        (pSET)NullSet        },
      { mGetInletMiserFlow,   (pSET)NullSet        },
      { mGetInletMiserTime,   (pSET)NullSet        },
      { (pGET)NullGet,        (pSET)NullSet        }},

     {{ mGetInletHasColumn,   mTestInletHasColumn  },
      { mGetInletMode,        mSetInletMode        }, /* splitless, has column */
      { mGetInletPres,        mSetInletPres        },
      { mGetInletPurgeFlow,   mSetInletPurgeFlow   },
      { mGetInletPurgeTime,   mSetInletPurgeTime   },
      { (pGET)NullGet,        (pSET)NullSet        },
      { (pGET)NullGet,        (pSET)NullSet        },
      { (pGET)NullGet,        (pSET)NullSet        },
      { mGetInletMiserFlow,   mSetInletMiserFlow   },
      { mGetInletMiserTime,   mSetInletMiserTime   },
      { mGetInletMiserState,  mSetInletMiserState  }}},


    {{{ mGetInletHasColumn,   mTestInletHasColumn  },
      { mGetInletMode,        mSetInletMode        }, /* pulsed, no column */
      { mGetInletPres,        mSetInletPres        },
      { mGetInletTotalFlow,   mSetInletTotalFlow   },
      { mGetInletPurgeTime,   mSetInletPurgeTime   },
      { (pGET)NullGet,        (pSET)NullSet        },
      { mGetInletPulsePres,   mSetInletPulsePres   },
      { mGetInletPulseTime,   mSetInletPulseTime   },
      { mGetInletMiserFlow,   (pSET)NullSet        },
      { mGetInletMiserTime,   (pSET)NullSet        },
      { (pGET)NullGet,        (pSET)NullSet        }},

     {{ mGetInletHasColumn,   mTestInletHasColumn  },
      { mGetInletMode,        mSetInletMode        }, /* pulsed, has column */
      { mGetInletPres,        mSetInletPres        },
      { mGetInletPurgeFlow,   mSetInletPurgeFlow   },
      { mGetInletPurgeTime,   mSetInletPurgeTime   },
      { (pGET)NullGet,        (pSET)NullSet        },
      { mGetInletPulsePres,   mSetInletPulsePres   },
      { mGetInletPulseTime,   mSetInletPulseTime   },
      { mGetInletMiserFlow,   mSetInletMiserFlow   },
      { mGetInletMiserTime,   mSetInletMiserTime   },
      { mGetInletMiserState,  mSetInletMiserState  }}},

    {{{ mGetInletHasColumn,   mTestInletHasColumn  },  /* pulsed split, no column */
      { mGetInletMode,        mSetInletMode        },
      { mGetInletPres,        mSetInletPres        },
      { mGetInletTotalFlow,   mSetInletTotalFlow   },
      { (pGET)NullGet,        (pSET)NullSet        },
      { (pGET)NullGet,        (pSET)NullSet        },
      { mGetInletPulsePres,   mSetInletPulsePres   },
      { mGetInletPulseTime,   mSetInletPulseTime   },
      { mGetInletMiserFlow,   (pSET)NullSet        },
      { mGetInletMiserTime,   (pSET)NullSet        },
      { (pGET)NullGet,        (pSET)NullSet        }},

     {{ mGetInletHasColumn,   mTestInletHasColumn  },
      { mGetInletMode,        mSetInletMode        }, /* pulsed split, has column */
      { mGetInletPres,        mSetInletPres        },
      { mGetInletSplitRatio,  mSetInletSplitRatio  },
      { (pGET)NullGet,        (pSET)NullSet        },
      { (pGET)NullGet,        (pSET)NullSet        },
      { mGetInletPulsePres,   mSetInletPulsePres   },
      { mGetInletPulseTime,   mSetInletPulseTime   },
      { mGetInletMiserFlow,   mSetInletMiserFlow   },
      { mGetInletMiserTime,   mSetInletMiserTime   },
      { mGetInletMiserState,  mSetInletMiserState  }}},

    {{{ mGetInletHasColumn,   mTestInletHasColumn  },
      { mGetInletMode,        mSetInletMode        }, /* solvent vent, no column */
      { mGetInletPres,        mSetInletPres        },
      { mGetInletTotalFlow,   mSetInletTotalFlow   },
      { mGetInletPurgeTime,   mSetInletPurgeTime   },
      { mGetInletVentFlow,    mSetInletVentFlow    },
      { mGetInletVentPres,    mSetInletVentPres    },
      { mGetInletVentTime,    mSetInletVentTime    },
      { mGetInletMiserFlow,   (pSET)NullSet        },
      { mGetInletMiserTime,   (pSET)NullSet        },
      { (pGET)NullGet,        (pSET)NullSet        }},

     {{ mGetInletHasColumn,   mTestInletHasColumn  },
      { mGetInletMode,        mSetInletMode        }, /* solvent vent, has column */
      { mGetInletPres,        mSetInletPres        },
      { mGetInletPurgeFlow,   mSetInletPurgeFlow   },
      { mGetInletPurgeTime,   mSetInletPurgeTime   },
      { mGetInletVentFlow,    mSetInletVentFlow    },
      { mGetInletVentPres,    mSetInletVentPres    },
      { mGetInletVentTime,    mSetInletVentTime    },
      { mGetInletMiserFlow,   mSetInletMiserFlow   },
      { mGetInletMiserTime,   mSetInletMiserTime   },
      { mGetInletMiserState,  mSetInletMiserState  }}}};





static INT32  mGetGptvInletParm       ( void *status, U_INT8 parm_num )
{
        return (INT32)GPTV_Cmd_Table [ (U_INT8) (((pINLET_STATUS)pneu_status)->Wkfile->Injection_Mode) ]
                                     [ (U_INT8) (((pINLET_STATUS)pneu_status)->Has_Column) ]
                                     [ parm_num ].Get     ( status, parm_num );
}


static UI_ERR mSetGptvInletParm       ( void *status, INT32 setpt, U_INT8 parm_num )
{
        return  GPTV_Cmd_Table  [ (U_INT8) (((pINLET_STATUS)pneu_status)->Wkfile->Injection_Mode) ]
                                [ (U_INT8) (((pINLET_STATUS)pneu_status)->Has_Column) ]
                                [ parm_num ].Set     ( status, setpt, parm_num );
}


   /* Inject_Mode is always the first parameter, this way any of the */
   /* flavors of this command will set it and point the rest of the  */
   /* parameters to the proper flavor (on a set).  On a Get, using   */
   /* the real inject mode will direct us to the proper flavor.      */
   /*                                                                */
   /* In all cases, (get & set) the column configuration must be sent*/
   /* first or the we will not get valid results.                    */


            /* split splitless direct */ /* col, no col */ /* parm num */
static const FUNC_TABLE_ENTRY VI_Cmd_Table[ 3 ][ 2 ][ 9 ] =

   {{{{ mGetInletHasColumn,   mTestInletHasColumn  },  /* split, no column */
      { mGetInletMode,        mSetInletMode        },
      { mGetInletPres,        mSetInletPres        },
      { mGetInletTotalFlow,   mSetInletTotalFlow   },
      { (pGET)NullGet,        (pSET)NullSet        },
      { mGetInletMiserFlow,   (pSET)NullSet        },
      { mGetInletMiserTime,   (pSET)NullSet        },
      { (pGET)NullGet,        (pSET)NullSet        },
      { mGetInletSmplgTime,   mSetInletSmplgTime   }},

     {{ mGetInletHasColumn,   mTestInletHasColumn  },
      { mGetInletMode,        mSetInletMode        }, /* split, has column */
      { mGetInletPres,        mSetInletPres        },
      { mGetInletSplitRatio,  mSetInletSplitRatio  },
      { (pGET)NullGet,        (pSET)NullSet        },
      { mGetInletMiserFlow,   mSetInletMiserFlow   },
      { mGetInletMiserTime,   mSetInletMiserTime   },
      { mGetInletMiserState,  mSetInletMiserState  },
      { mGetInletSmplgTime,   mSetInletSmplgTime   }}},

    {{{ mGetInletHasColumn,   mTestInletHasColumn  },
      { mGetInletMode,        mSetInletMode        }, /* splitless, no column */
      { mGetInletPres,        mSetInletPres        },
      { mGetInletTotalFlow,   mSetInletTotalFlow   },
      { mGetInletPurgeTime,   mSetInletPurgeTime   },
      { mGetInletMiserFlow,   (pSET)NullSet        },
      { mGetInletMiserTime,   (pSET)NullSet        },
      { (pGET)NullGet,        (pSET)NullSet        },
      { mGetInletSmplgTime,   mSetInletSmplgTime   }},

     {{ mGetInletHasColumn,   mTestInletHasColumn  },
      { mGetInletMode,        mSetInletMode        }, /* splitless, has column */
      { mGetInletPres,        mSetInletPres        },
      { mGetInletPurgeFlow,   mSetInletPurgeFlow   },
      { mGetInletPurgeTime,   mSetInletPurgeTime   },
      { mGetInletMiserFlow,   mSetInletMiserFlow   },
      { mGetInletMiserTime,   mSetInletMiserTime   },
      { mGetInletMiserState,  mSetInletMiserState  },
      { mGetInletSmplgTime,   mSetInletSmplgTime   }}},

    {{{ mGetInletHasColumn,   mTestInletHasColumn  },
      { mGetInletMode,        mSetInletMode        }, /* direct, no column */
      { mGetInletPres,        mSetInletPres        },
      { (pGET)NullGet,        (pSET)NullSet        },
      { (pGET)NullGet,        (pSET)NullSet        },
      { mGetInletMiserFlow,   (pSET)NullSet        },
      { mGetInletMiserTime,   (pSET)NullSet        },
      { (pGET)NullGet,        (pSET)NullSet        },
      { mGetInletSmplgTime,   mSetInletSmplgTime   }},

     {{ mGetInletHasColumn,   mTestInletHasColumn  },
      { mGetInletMode,        mSetInletMode        }, /* direct, has column */
      { mGetInletPres,        mSetInletPres        },
      { (pGET)NullGet,        (pSET)NullSet        },
      { (pGET)NullGet,        (pSET)NullSet        },
      { mGetInletMiserFlow,   (pSET)NullSet        },
      { mGetInletMiserTime,   (pSET)NullSet        },
      { (pGET)NullGet,        (pSET)NullSet        },
      { mGetInletSmplgTime,   mSetInletSmplgTime   }}}};


static INT32  mGetVIInletParm       ( void *status, U_INT8 parm_num )
{
/* !! WARNING !! This array ref ASSUMES that SPLIT =0 && SPLITLESS =1 &&  DIRECT !=6 !!  */
        return (INT32)  VI_Cmd_Table [ (U_INT8) (((pINLET_STATUS)pneu_status)->Wkfile->Injection_Mode) % 4 ]
                                     [ (U_INT8) (((pINLET_STATUS)pneu_status)->Has_Column) ]
                                     [ parm_num ].Get     ( status, parm_num );
}


static UI_ERR mSetVIInletParm       ( void *status, INT32 setpt, U_INT8 parm_num )
{

        /* !! WARNING !! This array ref ASSUMES that SPLIT =0 && SPLITLESS =1 &&  DIRECT !=6 !!  */
        /*               The "%4" in the next line uses this assumption.                         */
        return  VI_Cmd_Table  [ (U_INT8) (((pINLET_STATUS)pneu_status)->Wkfile->Injection_Mode) %4 ]
                              [ (U_INT8) (((pINLET_STATUS)pneu_status)->Has_Column) ]
                              [ parm_num ].Set     ( status, setpt, parm_num );
}


static const MULTIPLE_PTRS mpIFXX =
{
        &Inst_Status.Pneu.Frnt_Inlet,
        pFRONT_INLET_TEMP
};

static const MULTIPLE_PTRS mpIBXX =
{
        &Inst_Status.Pneu.Back_Inlet,
        pBACK_INLET_TEMP
};

static const MULTIPLE_PTRS mpOVXX =
{
        0,
        pOVEN_TEMP
};

static const METHCMD_ENTRY mmXXNZ[] =
{
      { mGetInletWkfileState, mSetInletState,  0, METH_ON_OFF  }
};

const METHCMD mIFNZ =
{
        MAXINDEX(mmXXNZ, METHCMD_ENTRY),
        &mmXXNZ[0],
        (MULTIPLE_PTRS * const) &mpIFXX,
        IFLockPneuWkfile,
        UnlockPneuWkfile
};

const METHCMD mIBNZ =
{
        MAXINDEX(mmXXNZ, METHCMD_ENTRY),
        &mmXXNZ[0],
        (MULTIPLE_PTRS * const) &mpIBXX,
        IBLockPneuWkfile,
        UnlockPneuWkfile
};


static const METHCMD_ENTRY mmXXSP[] =
{
      { mGetSsInletParm,       mSetSsInletParm,       0, METH_ON_OFF  },  /* has column  */
      { mGetSsInletParm,       mSetSsInletParm,       1, METH_NUM     },  /* inject mode */
      { mGetSsInletParm,       mSetSsInletParm,       2, METH_PRES    },  /* pressure    */
      { mGetSsInletParm,       mSetSsInletParm,       3, METH_FLOW    },  /* split ratio, purge flow, total flow */
      { mGetSsInletParm,       mSetSsInletParm,       4, METH_TIME    },  /* purge time  */
      { mGetSsInletParm,       mSetSsInletParm,       5, METH_PRES    },  /* pulse pres  */
      { mGetSsInletParm,       mSetSsInletParm,       6, METH_TIME    },  /* pulse time  */
      { mGetSsInletParm,       mSetSsInletParm,       7, METH_FLOW    },  /* saver flow  */
      { mGetSsInletParm,       mSetSsInletParm,       8, METH_TIME    },  /* saver time  */
      { mGetSsInletParm,       mSetSsInletParm,       9, METH_ON_OFF  }   /* saver on/off*/

};

const METHCMD mIFSP =          /* split splitless */
{
        MAXINDEX(mmXXSP, METHCMD_ENTRY),
        &mmXXSP[0],
        (MULTIPLE_PTRS * const) &mpIFXX,
        IFSPLockPneuWkfile,
        UnlockPneuWkfile
};

const METHCMD mIBSP =
{
        MAXINDEX(mmXXSP, METHCMD_ENTRY),
        &mmXXSP[0],
        (MULTIPLE_PTRS * const) &mpIBXX,
        IBSPLockPneuWkfile,
        UnlockPneuWkfile
};



static const METHCMD_ENTRY mmXXGP[] =
{
      { mGetGptvInletParm,       mSetGptvInletParm,       0, METH_ON_OFF  },  /* has column  */
      { mGetGptvInletParm,       mSetGptvInletParm,       1, METH_NUM     },  /* inject mode */
      { mGetGptvInletParm,       mSetGptvInletParm,       2, METH_PRES    },  /* pressure    */
      { mGetGptvInletParm,       mSetGptvInletParm,       3, METH_FLOW    },  /* split ratio, purge flow, total flow */
      { mGetGptvInletParm,       mSetGptvInletParm,       4, METH_TIME    },  /* purge time  */
      { mGetGptvInletParm,       mSetGptvInletParm,       5, METH_FLOW    },  /*               vent flow */
      { mGetGptvInletParm,       mSetGptvInletParm,       6, METH_PRES    },  /* pulse pres    vent pres*/
      { mGetGptvInletParm,       mSetGptvInletParm,       7, METH_TIME    },  /* pulse time  , vent time */
      { mGetGptvInletParm,       mSetGptvInletParm,       8, METH_FLOW    },  /* saver flow  */
      { mGetGptvInletParm,       mSetGptvInletParm,       9, METH_TIME    },  /* saver time  */
      { mGetGptvInletParm,       mSetGptvInletParm,      10, METH_ON_OFF  }   /* saver on/off*/

};

const METHCMD mIFGV =                      /* CIS4 */
{
        MAXINDEX(mmXXGP, METHCMD_ENTRY),
        &mmXXGP[0],
        (MULTIPLE_PTRS * const) &mpIFXX,
        IFGVLockPneuWkfile,
        UnlockPneuWkfile
};

const METHCMD mIBGV =
{
        MAXINDEX(mmXXGP, METHCMD_ENTRY),
        &mmXXGP[0],
        (MULTIPLE_PTRS * const) &mpIBXX,
        IBGVLockPneuWkfile,
        UnlockPneuWkfile
};

const METHCMD mIFGP =                      /* CIS3 */
{
        MAXINDEX(mmXXGP, METHCMD_ENTRY),
        &mmXXGP[0],
        (MULTIPLE_PTRS * const) &mpIFXX,
        IFGPLockPneuWkfile,
        UnlockPneuWkfile
};

const METHCMD mIBGP =
{
        MAXINDEX(mmXXGP, METHCMD_ENTRY),
        &mmXXGP[0],
        (MULTIPLE_PTRS * const) &mpIBXX,
        IBGPLockPneuWkfile,
        UnlockPneuWkfile
};


static const METHCMD_ENTRY mmXXVI[] =
{
      { mGetVIInletParm,       mSetVIInletParm,       0, METH_ON_OFF  },  /* has column  */
      { mGetVIInletParm,       mSetVIInletParm,       1, METH_NUM     },  /* inject mode */
      { mGetVIInletParm,       mSetVIInletParm,       2, METH_PRES    },  /* pressure    */
      { mGetVIInletParm,       mSetVIInletParm,       3, METH_FLOW    },  /* split ratio, purge flow, total flow */
      { mGetVIInletParm,       mSetVIInletParm,       4, METH_TIME    },  /* purge time  */
      { mGetVIInletParm,       mSetVIInletParm,       5, METH_FLOW    },  /* saver flow  */
      { mGetVIInletParm,       mSetVIInletParm,       6, METH_TIME    },  /* saver time  */
      { mGetVIInletParm,       mSetVIInletParm,       7, METH_ON_OFF  },  /* saver on/off*/
      { mGetVIInletParm,       mSetVIInletParm,       8, METH_TIME    }   /* smplg time  */

};

const METHCMD mIFVI =          /* volatiles       */
{
        MAXINDEX(mmXXVI, METHCMD_ENTRY),
        &mmXXVI[0],
        (MULTIPLE_PTRS * const) &mpIFXX,
        IFVILockPneuWkfile,
        UnlockPneuWkfile
};

const METHCMD mIBVI =
{
        MAXINDEX(mmXXVI, METHCMD_ENTRY),
        &mmXXVI[0],
        (MULTIPLE_PTRS * const) &mpIBXX,
        IBVILockPneuWkfile,
        UnlockPneuWkfile
};


static const METHCMD_ENTRY mmXXMS[] =
{
      { mGetInletMode,         mSetInletMode,         0, METH_NUM     },
      { mGetInletPurgeTime,    mSetInletPurgeTime,    0, METH_TIME    }

};

const METHCMD mIFMS =
{
        MAXINDEX(mmXXMS, METHCMD_ENTRY),
        &mmXXMS[0],
        (MULTIPLE_PTRS * const) &mpIFXX,
        IFMSLockPneuWkfile,
        UnlockPneuWkfile
};

const METHCMD mIBMS =
{
        MAXINDEX(mmXXMS, METHCMD_ENTRY),
        &mmXXMS[0],
        (MULTIPLE_PTRS * const) &mpIBXX,
        IBMSLockPneuWkfile,
        UnlockPneuWkfile
};

static const METHCMD_ENTRY mmXXCP[] =
{
      { mGetInletPres,       mSetInletPres,       0, METH_PRES }
};

const METHCMD mIFCP =          /* coc             */
{
        MAXINDEX(mmXXCP, METHCMD_ENTRY),
        &mmXXCP[0],
        (MULTIPLE_PTRS * const) &mpIFXX,
        IFCPLockPneuWkfile,
        UnlockPneuWkfile
};

const METHCMD mIBCP =
{
        MAXINDEX(mmXXCP, METHCMD_ENTRY),
        &mmXXCP[0],
        (MULTIPLE_PTRS * const) &mpIBXX,
        IBCPLockPneuWkfile,
        UnlockPneuWkfile
};



static const METHCMD_ENTRY mmXXPP[] =
{
      { mGetInletHasColumn,  mTestInletHasColumn, 0, METH_NUM  },
      { mGetPackedInletParm, mSetPackedInletParm, 1, METH_NUM  }
};

const METHCMD mIFPP =          /* pp              */
{
        MAXINDEX(mmXXPP, METHCMD_ENTRY),
        &mmXXPP[0],
        (MULTIPLE_PTRS * const) &mpIFXX,
        IFPPLockPneuWkfile,
        UnlockPneuWkfile
};

const METHCMD mIBPP =
{
        MAXINDEX(mmXXPP, METHCMD_ENTRY),
        &mmXXPP[0],
        (MULTIPLE_PTRS * const) &mpIBXX,
        IBPPLockPneuWkfile,
        UnlockPneuWkfile
};

const METHCMD mIFDP =          /* sim dist        */
{
        MAXINDEX(mmXXPP, METHCMD_ENTRY),
        &mmXXPP[0],
        (MULTIPLE_PTRS * const) &mpIFXX,
        IFDPLockPneuWkfile,
        UnlockPneuWkfile
};

const METHCMD mIBDP =
{
        MAXINDEX(mmXXPP, METHCMD_ENTRY),
        &mmXXPP[0],
        (MULTIPLE_PTRS * const) &mpIBXX,
        IBDPLockPneuWkfile,
        UnlockPneuWkfile
};

static const METHCMD_ENTRY mmXXCI[] =
{
      { mGetInletHasColumn,  mTestInletHasColumn, 0, METH_NUM  },
      { mGetPackedInletParm, mSetPackedInletParm, 1, METH_NUM  }  /* ~ col pressure if defined col */
                                                                  /* ~ col flow   if undefined col */
};

const METHCMD mIFCI =
{
        MAXINDEX(mmXXCI, METHCMD_ENTRY),
        &mmXXCI[0],
        (MULTIPLE_PTRS * const) &mpIFXX,
        IFLockPneuWkfile,
        UnlockPneuWkfile
};

const METHCMD mIBCI =
{
        MAXINDEX(mmXXCI, METHCMD_ENTRY),
        &mmXXCI[0],
        (MULTIPLE_PTRS * const) &mpIBXX,
        IBLockPneuWkfile,
        UnlockPneuWkfile
};


static const METHCMD_ENTRY mmXXST[] =
{
      { mGetInletMode,       (SET)NullFunc,      0, METH_NUM },
      { mGetTempStatus,      (SET)NullFunc,      1, METH_ZONE_ERR}, /* thermal status */
      { mGetTempSetpt,       (SET)NullFunc,      2, METH_TEMP},     /* thermal setpt  */
      { mGetTempActual,      (SET)NullFunc,      3, METH_TEMP},     /* thermal actual */
      { mGetInletStatus,     (SET)NullFunc,      4, METH_PRES },    /* pneu status    */
      { mGetInletTotalFlow,  (SET)NullFunc,      5, METH_FLOW },    /* flow setpt     */
      { mGetInletFlowActual, (SET)NullFunc,      6, METH_FLOW },    /* flow actual    */
      { mGetInletPres,       (SET)NullFunc,      7, METH_PRES },    /* pres setpt     */
      { mGetInletPresActual, (SET)NullFunc,      8, METH_PRES }     /* pres actual    */
};

const METHCMD mIFST =
{
        MAXINDEX(mmXXST, METHCMD_ENTRY),
        &mmXXST[0],
        (MULTIPLE_PTRS * const) &mpIFXX,
        LockPneuWkfile,
        UnlockPneuWkfile
};

const METHCMD mIBST =
{
        MAXINDEX(mmXXST, METHCMD_ENTRY),
        &mmXXST[0],
        (MULTIPLE_PTRS * const) &mpIBXX,
        LockPneuWkfile,
        UnlockPneuWkfile
};

const METHCMD mOVST =
{
        3 - 1,       /* only table elements 1..3 are used */
        &mmXXST[1],
        (MULTIPLE_PTRS * const) &mpOVXX,
        DummyFunc,
        DummyFunc
};


static const METHCMD_ENTRY mmXXCF[] =
{
      { mGetInletGasType,       mSetInletGasType,               0,      METH_NUM },
      { mGetInletPresEquib,             mSetInletPresEquib,             5,      METH_TIME },
      { mGetInletFlowEquib,             mSetInletFlowEquib,             6,      METH_TIME },
};

static const METHCMD_ENTRY mmXXCW[] =
{
      {mGetInletType,                   mLetInletType,                  0,      METH_NUM},
      {mGetZonePresence,                mLetZonePresence,               1,      METH_NUM},
      {mGetInletPneuCfg,                mLetInletPneuCfg,               2,      METH_NUM},
      {mGetInletPSensorRange,   mLetInletPSensorRange,  3,      METH_NUM},
      {mGetInletGasType,                mLetInletGasType,               4,      METH_NUM},
      {mGetInletPresEquib,              mLetInletPresEquib,             5,      METH_TIME},
      {mGetInletFlowEquib,              mLetInletFlowEquib,             6,      METH_TIME}
};

const METHCMD mIFCF =
{
        MAXINDEX(mmXXCF, METHCMD_ENTRY),
        &mmXXCF[0],
        (MULTIPLE_PTRS * const) &mpIFXX,
        LockPneuWkfile,
        UnlockPneuWkfile
};

const METHCMD mIBCF =
{
        MAXINDEX(mmXXCF, METHCMD_ENTRY),
        &mmXXCF[0],
        (MULTIPLE_PTRS * const) &mpIBXX,
        LockPneuWkfile,
        UnlockPneuWkfile
};

const METHCMD mIFCW =
{
        MAXINDEX(mmXXCW, METHCMD_ENTRY),
        &mmXXCW[0],
        (MULTIPLE_PTRS * const) &mpIFXX,
        LockPneuWkfile,
        UnlockPneuWkfile
};

const METHCMD mIBCW =
{
        MAXINDEX(mmXXCW, METHCMD_ENTRY),
        &mmXXCW[0],
        (MULTIPLE_PTRS * const) &mpIBXX,
        LockPneuWkfile,
        UnlockPneuWkfile
};

static const METHCMD_ENTRY mmXXTP[] =
{
      { mGetInletType,    mSetInletType,   0, METH_NUM },
};

const METHCMD mIFTP =
{
        MAXINDEX(mmXXTP, METHCMD_ENTRY),
        &mmXXTP[0],
        (MULTIPLE_PTRS * const) &mpIFXX,
        DummyFunc,
        DummyFunc
};

const METHCMD mIBTP =
{
        MAXINDEX(mmXXTP, METHCMD_ENTRY),
        &mmXXTP[0],
        (MULTIPLE_PTRS * const) &mpIBXX,
        DummyFunc,
        DummyFunc
};


/************  CPF  *****************************/
static const METHCMD_ENTRY mmXXTW[] =
{
      { mGetCPFInletTitle,    (SET)NullFunc,   0, METH_CSTR },
};

const METHCMD mIFTW =
{
        MAXINDEX(mmXXTW, METHCMD_ENTRY),
        &mmXXTW[0],
        (MULTIPLE_PTRS * const) &mpIFXX,
        DummyFunc,
        DummyFunc
};

const METHCMD mIBTW =
{
        MAXINDEX(mmXXTP, METHCMD_ENTRY),
        &mmXXTW[0],
        (MULTIPLE_PTRS * const) &mpIBXX,
        DummyFunc,
        DummyFunc
};
/***************************************************************************/

static const METHCMD_ENTRY mmXXPI[] =
{
      { mGetInletPres,       mSetInletPresNow,   0, METH_NUM },
};

const METHCMD mIFPI =
{
        MAXINDEX(mmXXPI, METHCMD_ENTRY),
        &mmXXPI[0],
        (MULTIPLE_PTRS * const) &mpIFXX,
        LockPneuWkfile,
        UnlockPneuWkfile
};

const METHCMD mIBPI =
{
        MAXINDEX(mmXXPI, METHCMD_ENTRY),
        &mmXXPI[0],
        (MULTIPLE_PTRS * const) &mpIBXX,
        LockPneuWkfile,
        UnlockPneuWkfile
};


/***************************************************************************/
/***************************************************************************/

static const METHCMD_ENTRY mmXXFI[] =
{
      { mGetInletTotalFlow,   mSetInletFlowNow,  0, METH_NUM },
};

const METHCMD mIFFI =
{
        MAXINDEX(mmXXFI, METHCMD_ENTRY),
        &mmXXFI[0],
        (MULTIPLE_PTRS * const) &mpIFXX,
        LockPneuWkfile,
        UnlockPneuWkfile
};

const METHCMD mIBFI =
{
        MAXINDEX(mmXXFI, METHCMD_ENTRY),
        &mmXXFI[0],
        (MULTIPLE_PTRS * const) &mpIBXX,
        LockPneuWkfile,
        UnlockPneuWkfile
};


/***************************************************************************/
/***************************************************************************/

#if 0
static const METHCMD_ENTRY mmXXQI[] =
{
      { mGetInletSplitFlow,   mSetInletSplitFlowNow,  0, METH_NUM },
};
#endif


/***************************************************************************/
/***************************************************************************/

static const METHCMD_ENTRY mmXXRC[] =
{
      { mGetSprParm1,        (SET)NullFunc,      0, METH_NUM }, /* N2 */
      { mGetSprParm2,        (SET)NullFunc,      0, METH_NUM },
      { mGetSprParm1,        (SET)NullFunc,      1, METH_NUM }, /* H2 */
      { mGetSprParm2,        (SET)NullFunc,      1, METH_NUM },
      { mGetSprParm1,        (SET)NullFunc,      2, METH_NUM }, /* He */
      { mGetSprParm2,        (SET)NullFunc,      2, METH_NUM },
      { mGetSprParm1,        (SET)NullFunc,      3, METH_NUM }, /* ArMe */
      { mGetSprParm2,        (SET)NullFunc,      3, METH_NUM }
};

const METHCMD mIFRC =
{
        MAXINDEX(mmXXRC, METHCMD_ENTRY),
        &mmXXRC[0],
        &Inst_Status.Pneu.Frnt_Inlet,
        LockPneuWkfile,
        UnlockPneuWkfile
};

const METHCMD mIBRC =
{
        MAXINDEX(mmXXRC, METHCMD_ENTRY),
        &mmXXRC[0],
        &Inst_Status.Pneu.Back_Inlet,
        LockPneuWkfile,
        UnlockPneuWkfile
};

/***************************************************************************/
/***************************************************************************/

static const METHCMD_ENTRY mmXXTC[] =
{
      { mGetInletTempComp,   mSetInletTempComp,  0, METH_NUM },
      { mGetInletAmbTemp,    (SET)NullFunc,      4, METH_NUM },
      { mGetInletFlowDVolts, (SET)NullFunc,      5, METH_NUM },
      { mGetInletPresDVolts, (SET)NullFunc,      6, METH_NUM }
};

const METHCMD mIFTC =
{
        MAXINDEX(mmXXTC, METHCMD_ENTRY),
        &mmXXTC[0],
        &Inst_Status.Pneu.Frnt_Inlet,
        LockPneuWkfile,
        UnlockPneuWkfile
};

const METHCMD mIBTC =
{
        MAXINDEX(mmXXTC, METHCMD_ENTRY),
        &mmXXTC[0],
        &Inst_Status.Pneu.Back_Inlet,
        LockPneuWkfile,
        UnlockPneuWkfile
};



static INT32 mGetInletTempComp       ( void *status, U_INT8 unused_parm )
{
      (void) unused_parm;
      return ((pINLET_STATUS)status)->Tcomp_Tables->Flow_Sensor.Temp_Comp_Enabled;
}

static UI_ERR mSetInletTempComp   ( void *status, INT32 setpt, U_INT8 unused_parm )
{
      (void) unused_parm;

      ((pINLET_STATUS)status)->Tcomp_Tables->Flow_Sensor.Temp_Comp_Enabled = ( setpt != 0 );
      ((pINLET_STATUS)status)->Tcomp_Tables->Pres_Sensor.Temp_Comp_Enabled = ( setpt != 0 );

      if ( setpt == 0 )
      {
          ((pINLET_STATUS)status)->Tcomp_Tables->Pres_Sensor.Pres_dV_Setpt = 0;
          ((pINLET_STATUS)status)->Tcomp_Tables->Flow_Sensor.dV_Setpt      = 0;
      }

      return OK;
}

static INT32 mGetInletAmbTemp        ( void *status, U_INT8 unused_parm )
{
      (void) unused_parm;
      return ((pINLET_STATUS)status)->Tcomp_Tables->Thermistor.Module_Temperature;
}

static INT32 mGetInletFlowDVolts     ( void *status, U_INT8 unused_parm )
{
      (void) unused_parm;
      return ((pINLET_STATUS)status)->Tcomp_Tables->Flow_Sensor.dV_Setpt * 1000 / 16384;
}

static INT32 mGetInletPresDVolts     ( void *status, U_INT8 unused_parm )
{
      (void) unused_parm;
      return ((pINLET_STATUS)status)->Tcomp_Tables->Pres_Sensor.Pres_dV_Setpt * 1000 / 16384;
}


/***************************************************************************/



static const METHCMD_ENTRY mmIXLP[] =
{
        { mGetInletCalPres,   mSetInletCalPres,   0, METH_PRES }
};

static const METHCMD_ENTRY mmIXLF[] =
{
        { mGetInletCalFlow,   mSetInletCalFlow,   0, METH_FLOW }
};

static const METHCMD_ENTRY mmIXZP[] =
{
        { mGetInletCalPresZero, mSetInletCalPresZero, 0, METH_PRES }
};

static const METHCMD_ENTRY mmIXFZ[] =
{
        { mGetInletCalPresZero, mSetInletFactoryCalPresZero, 0, METH_PRES }
};

static const METHCMD_ENTRY mmIXZF[] =
{
        { mGetInletCalFlowZero, mSetInletCalFlowZero, 0, METH_FLOW }
};

static const METHCMD_ENTRY mmIXZS[] =
{
        { mGetInletCalZeroState, (SET)NullFunc,        0, METH_FLOW }
};


static const METHCMD_ENTRY mmIXAC[] =
{
        { mGetInletAutoCal,  (SET)mSetInletAutoCal,    0, METH_FLOW }
};

static const METHCMD_ENTRY mmIXLS[] =
{
        { mGetInletCalState,    (SET)NullFunc, 0, METH_INT0 },
        { mGetInletCalDate,     (SET)NullFunc, 0, METH_INT0 },
        { mGetInletCalPresZero, (SET)NullFunc, 0, METH_PRES },
        { mGetInletCalFlowZero, (SET)NullFunc, 0, METH_FLOW },
        { mGetInletCalPres,     (SET)NullFunc, 0, METH_PRES },
        { mGetInletCalFlow,     (SET)NullFunc, 0, METH_FLOW },
        { mGetInletCalPresGain, (SET)NullFunc, 0, METH_INT2 },
        { mGetInletCalFlowGain, (SET)NullFunc, 0, METH_INT2 }
};

static const METHCMD_ENTRY mmIXLX[] =
{
        { mGetInletCalState,    mSetInletCalState, 0, METH_INT0 }
};





const METHCMD mIFLF =
{
        MAXINDEX(mmIXLF, METHCMD_ENTRY),
        &mmIXLF[0],
        (MULTIPLE_PTRS * const) &mpIFXX,
        LockPneuWkfile,
        UnlockPneuWkfile
};

const METHCMD mIBLF =
{
        MAXINDEX(mmIXLF, METHCMD_ENTRY),
        &mmIXLF[0],
        (MULTIPLE_PTRS * const) &mpIBXX,
        LockPneuWkfile,
        UnlockPneuWkfile
};

const METHCMD mIFZF =
{
        MAXINDEX(mmIXZF, METHCMD_ENTRY),
        &mmIXZF[0],
        (MULTIPLE_PTRS * const) &mpIFXX,
        LockPneuWkfile,
        UnlockPneuWkfile
};

const METHCMD mIBZF =
{
        MAXINDEX(mmIXZF, METHCMD_ENTRY),
        &mmIXZF[0],
        (MULTIPLE_PTRS * const) &mpIBXX,
        LockPneuWkfile,
        UnlockPneuWkfile
};



const METHCMD mIFZS =
{
        MAXINDEX(mmIXZS, METHCMD_ENTRY),
        &mmIXZS[0],
        (MULTIPLE_PTRS * const) &mpIFXX,
        LockPneuWkfile,
        UnlockPneuWkfile
};

const METHCMD mIBZS =
{
        MAXINDEX(mmIXZS, METHCMD_ENTRY),
        &mmIXZS[0],
        (MULTIPLE_PTRS * const) &mpIBXX,
        LockPneuWkfile,
        UnlockPneuWkfile
};




const METHCMD mIFLP =
{
        MAXINDEX(mmIXLP, METHCMD_ENTRY),
        &mmIXLP[0],
        (MULTIPLE_PTRS * const) &mpIFXX,
        LockPneuWkfile,
        UnlockPneuWkfile
};

const METHCMD mIBLP =
{
        MAXINDEX(mmIXLP, METHCMD_ENTRY),
        &mmIXLP[0],
        (MULTIPLE_PTRS * const) &mpIBXX,
        LockPneuWkfile,
        UnlockPneuWkfile
};

const METHCMD mIFZP =
{
        MAXINDEX(mmIXZP, METHCMD_ENTRY),
        &mmIXZP[0],
        (MULTIPLE_PTRS * const) &mpIFXX,
        LockPneuWkfile,
        UnlockPneuWkfile
};

const METHCMD mIBZP =
{
        MAXINDEX(mmIXZP, METHCMD_ENTRY),
        &mmIXZP[0],
        (MULTIPLE_PTRS * const) &mpIBXX,
        LockPneuWkfile,
        UnlockPneuWkfile
};


const METHCMD mIFFZ =
{
        MAXINDEX(mmIXFZ, METHCMD_ENTRY),
        &mmIXFZ[0],
        (MULTIPLE_PTRS * const) &mpIFXX,
        LockPneuWkfile,
        UnlockPneuWkfile
};

const METHCMD mIBFZ =
{
        MAXINDEX(mmIXFZ, METHCMD_ENTRY),
        &mmIXFZ[0],
        (MULTIPLE_PTRS * const) &mpIBXX,
        LockPneuWkfile,
        UnlockPneuWkfile
};






const METHCMD mIFAC =
{
        MAXINDEX(mmIXAC, METHCMD_ENTRY),
        &mmIXAC[0],
        (MULTIPLE_PTRS * const) &mpIFXX,
        LockPneuWkfile,
        UnlockPneuWkfile
};

const METHCMD mIBAC =
{
        MAXINDEX(mmIXAC, METHCMD_ENTRY),
        &mmIXAC[0],
        (MULTIPLE_PTRS * const) &mpIBXX,
        LockPneuWkfile,
        UnlockPneuWkfile
};




const METHCMD mIFLS =
{
        MAXINDEX(mmIXLS, METHCMD_ENTRY),
        &mmIXLS[0],
        (MULTIPLE_PTRS * const) &mpIFXX,
        LockPneuWkfile,
        UnlockPneuWkfile
};

const METHCMD mIBLS =
{
        MAXINDEX(mmIXLS, METHCMD_ENTRY),
        &mmIXLS[0],
        (MULTIPLE_PTRS * const) &mpIBXX,
        LockPneuWkfile,
        UnlockPneuWkfile
};


const METHCMD mIFLX =
{
        MAXINDEX(mmIXLX, METHCMD_ENTRY),
        &mmIXLX[0],
        (MULTIPLE_PTRS * const) &mpIFXX,
        LockPneuWkfile,
        UnlockPneuWkfile
};

const METHCMD mIBLX =
{
        MAXINDEX(mmIXLX, METHCMD_ENTRY),
        &mmIXLX[0],
        (MULTIPLE_PTRS * const) &mpIBXX,
        LockPneuWkfile,
        UnlockPneuWkfile
};



/***********************************************************************************/


static INT32  mGetInletMode       ( void *status, U_INT8 unused_parm )
{
        (void) unused_parm;

        return (INT32) GetInletInjectMode ( pneu_status );
}

static INT32  mGetTempStatus      ( void *status, U_INT8 unused_parm )
{
   OVEN_STATUS oven_status;

        (void) unused_parm;

        if ( zone_status == pOVEN_TEMP )
        {
           oven_status = GetOvenStatus();
           return oven_status.word;
        }

        return (INT32) GetTempStatus ( zone_status );
}

static INT32  mGetTempSetpt       ( void *status, U_INT8 unused_parm )
{
        (void) unused_parm;

        return GetTempSetpt ( zone_status );
}

static INT32  mGetTempActual      ( void *status, U_INT8 unused_parm )
{
        (void) unused_parm;

        return GetTempActual ( zone_status );
}

static INT32  mGetInletPres       ( void *status, U_INT8 unused_parm )
{
        (void) unused_parm;

       return DcGetInletWkfilePresSetpt ( pneu_status  );
}


static INT32  mGetInletWkfileState( void *status, U_INT8 unused_parm )
{
        (void) unused_parm;

       return (INT32)GetInletWkfileState ( pneu_status  );
}

static INT32  mGetInletPresActual ( void *status, U_INT8 unused_parm )
{
        (void) unused_parm;

       return DcGetInletPresActual ( pneu_status );
}

static INT32  mGetInletPurgeFlow  ( void *status, U_INT8 unused_parm )
{
        (void) unused_parm;

       return DcGetInletPurgeFlow ( pneu_status );
}

static INT32  mGetInletPurgeTime  ( void *status, U_INT8 unused_parm )
{
        (void) unused_parm;

       return GetInletPurgeTime ( pneu_status );
}

static INT32  mGetPackedInletParm  ( void *status, U_INT8 unused_parm )
{
        (void) unused_parm;

       if ( InletHasColumn( pneu_status ) )
       {
          return DcGetInletWkfilePresSetpt ( pneu_status  );
       }
       else
       {
          return DcGetInletWkfileFlowSetpt( pneu_status );
       }
}

static INT32  mGetInletTotalFlow  ( void *status, U_INT8 unused_parm )
{
        (void) unused_parm;

       return DcGetInletWkfileFlowSetpt( pneu_status );
}

static INT32  mGetInletFlowActual ( void *status, U_INT8 unused_parm )
{
        (void) unused_parm;

       return DcGetInletFlowActual( pneu_status );
}

static INT32  mGetInletSplitRatio ( void *status, U_INT8 unused_parm )
{
        (void) unused_parm;

       return DcGetInletSplitRatio ( pneu_status );
}

#if 0
static INT32  mGetInletSplitFlow  ( void *status, U_INT8 unused_parm )
{
        (void) unused_parm;

       return DcGetInletSplitFlow( pneu_status );
}
#endif

static INT32  mGetInletVentPres   ( void *status, U_INT8 unused_parm )
{
        (void) unused_parm;

       return DcGetVentPressure ( pneu_status );
}

static INT32  mGetInletVentFlow   ( void *status, U_INT8 unused_parm )
{
        (void) unused_parm;

       return DcGetInletVentFlow ( pneu_status );
}

static INT32  mGetInletVentTime   ( void *status, U_INT8 unused_parm )
{
        (void) unused_parm;

       return GetVentTime ( pneu_status );
}

static INT32  mGetInletPulsePres  ( void *status, U_INT8 unused_parm )
{
        (void) unused_parm;

       return DcGetPressurePulsePressure ( pneu_status );
}

static INT32  mGetInletPulseTime  ( void *status, U_INT8 unused_parm )
{
        (void) unused_parm;

       return GetPressurePulseTime ( pneu_status );
}

static INT32  mGetInletMiserFlow  ( void *status, U_INT8 unused_parm )
{
        (void) unused_parm;

       return DcGetInletMiserFlow ( pneu_status );
}

static INT32  mGetInletMiserTime  ( void *status, U_INT8 unused_parm )
{
        (void) unused_parm;

       return GetInletMiserTime ( pneu_status );
}

static INT32  mGetInletMiserState ( void *status, U_INT8 unused_parm )
{
        (void) unused_parm;

       return (INT32)GetInletMiserMode( pneu_status );
}


static INT32  mGetInletSmplgTime  ( void *status, U_INT8 unused_parm )
{
        (void) unused_parm;

       return DcGetVIInjTime ( pneu_status );
}


static INT32  mGetInletStatus     ( void *status, U_INT8 unused_parm )
{
        (void) unused_parm;

 return (INT32) VIInjFlowActive          ( pneu_status ) << 5 |
        (INT32) ((INT32)GetInletState    ( pneu_status ) & 0x03) << 3 |
        (INT32) InletPurgeActive         ( pneu_status ) << 2 |
        (INT32) InletMiserModeActive     ( pneu_status ) << 1 |
        (INT32) InletPressurePulseActive ( pneu_status );

}

static INT32  mGetInletGasType  ( void *status, U_INT8 unused_parm )
{
        (void) unused_parm;

       return (INT32)GetInletGasType ( pneu_status );
}


static INT32  mGetInletPresEquib  ( void *status, U_INT8 unused_parm )
{
        (void) unused_parm;

       return GetInletPresEquibTime ( pneu_status );
}

static INT32  mGetInletFlowEquib  ( void *status, U_INT8 unused_parm )
{
        (void) unused_parm;

       return GetInletFlowEquibTime ( pneu_status );
}

static INT32  mGetInletType( void *status, U_INT8 unused_parm )
{
      (void) unused_parm;

       return (INT32)GetInletType( pneu_status );
}

static INT32  mGetSprParm1( void *status, U_INT8 gas )
{
      return GetSprFlowConst( status, (GAS_TYPE)gas );

}

static INT32  mGetSprParm2( void *status, U_INT8 gas )
{
      return GetSprDflowConst( status, (GAS_TYPE)gas );
}

static INT32 mGetZonePresence(void *status, U_INT8 num)
{
        (void) num;
        return (INT32)GetZonePresence( zone_status );
}

static INT32 mGetInletPneuCfg(void *status, U_INT8 num)
{
   (void )     num;

       if ( EpcInletChk ( pneu_status ) )
       {
          answer=1 ;
       }
       else
       {
         answer=0 ;
       }
       if ( (GetInletType( pneu_status ) == VOLATILES ) && ( GetVISplitPort( pneu_status ) == CAPPED ) ) answer=answer+2 ;

       return answer ;
}

static INT32 mGetInletPSensorRange(void *status, U_INT8 num)
{
        (void) num;

        return GetInletPSensorRange( pneu_status );
}

static INT32  mGetCPFInletTitle  ( void *status, U_INT8 unused_parm )
{
     (void) unused_parm;

     if(GetCPFInletTitlePresence( (pneu_status == &Inst_Status.Pneu.Frnt_Inlet)? FRONT:BACK ))
     {
        return (INT32) GetCPFInletTitle ( (pneu_status == &Inst_Status.Pneu.Frnt_Inlet)?
                          FRONT : BACK );
     }
     else
     {
        return (INT32)"";
     }
}


/********************************************************************/


static UI_ERR mSetInletMode       ( void *status, INT32 setpt, U_INT8 unused_parm )
{
        (void) unused_parm;

       return  DcSetInletInjectMode ( (INJ_MODE) setpt, pneu_status );
}

static UI_ERR mSetInletPres       ( void *status, INT32 setpt, U_INT8 unused_parm )
{
        (void) unused_parm;

       return  DcSetInletPresSetpt( setpt, pneu_status );
}

static UI_ERR mSetInletPresNow    ( void *status, INT32 setpt, U_INT8 unused_parm )
{
        (void) unused_parm;

       return  DcSetInletPresSetptImmediate( setpt, pneu_status );
}

static UI_ERR mSetInletState      ( void *status, INT32 setpt, U_INT8 unused_parm )
{
        (void) unused_parm;

       return  DcSetInletState( (ON_OFF)setpt, pneu_status );
}

static UI_ERR mSetInletPurgeFlow  ( void *status, INT32 setpt, U_INT8 unused_parm )
{
        (void) unused_parm;

       return  DcSetInletPurgeFlow( setpt, pneu_status );
}

static UI_ERR mSetInletPurgeTime  ( void *status, INT32 setpt, U_INT8 unused_parm )
{
        (void) unused_parm;

       return  DcSetInletPurgeTime( setpt, pneu_status );
}

static UI_ERR mSetInletFlowNow    ( void *status, INT32 setpt, U_INT8 unused_parm )
{
        (void) unused_parm;

       return  DcSetInletFlowSetptImmediate ( setpt, pneu_status );
}

#if 0
static UI_ERR mSetInletSplitFlowNow    ( void *status, INT32 setpt, U_INT8 unused_parm )
{
        (void) unused_parm;

       return  DcSetInletSplitFlow( setpt, pneu_status );
}
#endif

static UI_ERR mSetInletTotalFlow  ( void *status, INT32 setpt, U_INT8 unused_parm )
{
        (void) unused_parm;

       return  DcSetInletFlowSetpt ( setpt, pneu_status );
}

static UI_ERR mSetPackedInletParm  ( void *status, INT32 setpt, U_INT8 unused_parm )
{
        (void) unused_parm;


       if ( InletHasColumn( pneu_status ) )
       {
           return  DcSetInletPresSetpt ( setpt, pneu_status );
       }
       else
       {
           return  DcSetInletFlowSetpt ( setpt, pneu_status );
       }
}

static UI_ERR mSetInletSplitRatio ( void *status, INT32 setpt, U_INT8 unused_parm )
{
        (void) unused_parm;

       return  DcSetInletSplitRatio ( setpt, pneu_status );
}

static UI_ERR mSetInletVentPres   ( void *status, INT32 setpt, U_INT8 unused_parm )
{
        (void) unused_parm;

       return  DcSetVentPressure( setpt, pneu_status );
}

static UI_ERR mSetInletVentFlow   ( void *status, INT32 setpt, U_INT8 unused_parm )
{
        (void) unused_parm;

       return  DcSetInletVentFlow( setpt, pneu_status );
}

static UI_ERR mSetInletVentTime   ( void *status, INT32 setpt, U_INT8 unused_parm )
{
        (void) unused_parm;

       return  DcSetVentTime( setpt, pneu_status );
}

static UI_ERR mSetInletPulsePres  ( void *status, INT32 setpt, U_INT8 unused_parm )
{
        (void) unused_parm;

       return  DcSetPressurePulsePressure( setpt, pneu_status );
}

static UI_ERR mSetInletPulseTime  ( void *status, INT32 setpt, U_INT8 unused_parm )
{
        (void) unused_parm;

       return  DcSetPressurePulseTime( setpt, pneu_status );
}

static UI_ERR mSetInletMiserFlow  ( void *status, INT32 setpt, U_INT8 unused_parm )
{
        (void) unused_parm;

       return  DcSetInletMiserFlow( setpt, pneu_status );
}

static UI_ERR mSetInletMiserTime  ( void *status, INT32 setpt, U_INT8 unused_parm )
{
        (void) unused_parm;

       return  DcSetInletMiserTime( setpt, pneu_status );
}

static UI_ERR mSetInletSmplgTime  ( void *status, INT32 setpt, U_INT8 unused_parm )
{
        (void) unused_parm;

       return  DcSetVIInjTime ( setpt, pneu_status );
}

static UI_ERR mSetInletMiserState ( void *status, INT32 setpt, U_INT8 unused_parm )
{
        (void) unused_parm;

       return  SetInletMiserMode( (ON_OFF)setpt, pneu_status );
}

static UI_ERR mSetInletGasType( void *status, INT32 setpt, U_INT8 unused_parm )
{
        (void) unused_parm;

       return  (UI_ERR) DcSetInletGasType( (GAS_TYPE)setpt, pneu_status );
}


static UI_ERR mSetInletPresEquib  ( void *status, INT32 setpt, U_INT8 unused_parm )
{
        (void) unused_parm;

       return  (UI_ERR) DcSetInletPresEquibTime( setpt, pneu_status );
}

static UI_ERR mSetInletFlowEquib  ( void *status, INT32 setpt, U_INT8 unused_parm )
{
        (void) unused_parm;

       return  (UI_ERR) DcSetInletFlowEquibTime( setpt, pneu_status );
}

static UI_ERR mSetInletType( void *status, INT32 setpt, U_INT8 unused_parm )
{
      (void) unused_parm;

       return SetInletType( pneu_status, (INLET_TYPE) setpt );
}

static INT32  mGetInletHasColumn  ( void *status, U_INT8 unused_parm )
{
       (void) unused_parm;

       return (INT32)InletHasColumn( pneu_status );
}

static UI_ERR mTestInletHasColumn ( void *status, INT32 setpt, U_INT8 unused_parm )
{
     (void) unused_parm;

     if ( (INT32)InletHasColumn(pneu_status) != setpt ) return COMMAND_ABORTED;
     else                                          return OK;

}

static INT32  mGetInletCalPres    ( void *status, U_INT8 unused_parm )
{
     (void) unused_parm;
     return  DcGetInletCalPres ( pneu_status );
}
static INT32  mGetInletCalFlow    ( void *status, U_INT8 unused_parm )
{
     (void) unused_parm;
     return  DcGetInletCalFlow ( pneu_status );
}
static INT32  mGetInletCalZeroState( void *status, U_INT8 unused_parm )
{
     (void) unused_parm;
     return  (INT32) DcGetInletCalFlowZeroState ( pneu_status );
}
static INT32  mGetInletCalPresZero( void *status, U_INT8 unused_parm )
{
     (void) unused_parm;
     return  DcGetInletCalPresZero ( pneu_status );
}
static INT32  mGetInletCalFlowZero( void *status, U_INT8 unused_parm )
{
     (void) unused_parm;
     return  DcGetInletCalFlowZero ( pneu_status );
}
static INT32  mGetInletCalPresGain( void *status, U_INT8 unused_parm )
{
     (void) unused_parm;
     return  DcGetInletCalPresGain ( pneu_status );
}
static INT32  mGetInletCalFlowGain( void *status, U_INT8 unused_parm )
{
     (void) unused_parm;
     return  DcGetInletCalFlowGain ( pneu_status );
}
static INT32  mGetInletCalState   ( void *status, U_INT8 unused_parm )
{
     (void) unused_parm;
     return  (INT32) InletUserCalibState ( pneu_status );
}
static INT32  mGetInletCalDate    ( void *status, U_INT8 unused_parm )
{
     (void) unused_parm;
     return  SecondsSince1980( GetInletCalibDate ( pneu_status ) );
}


static UI_ERR mSetInletCalPres    ( void *status, INT32 setpt, U_INT8 unused_parm )
{
     (void) unused_parm;
     return  DcSetInletCalPres ( pneu_status, setpt );
}
static UI_ERR mSetInletCalFlow    ( void *status, INT32 setpt, U_INT8 unused_parm )
{
     (void) unused_parm;
     return  DcSetInletCalFlow ( pneu_status, setpt );
}
static UI_ERR mSetInletCalPresZero( void *status, INT32 setpt, U_INT8 unused_parm )
{
     (void) unused_parm;
     (void) setpt;
     return  DcSetInletCalPresZero ( pneu_status );
}
static UI_ERR mSetInletFactoryCalPresZero( void *status, INT32 setpt, U_INT8 unused_parm )
{
     (void) unused_parm;
     (void) setpt;
     return  DcSetInletFactoryCalPresZero ( pneu_status );
}
static UI_ERR mSetInletCalFlowZero( void *status, INT32 setpt, U_INT8 unused_parm )
{
     (void) unused_parm;
     (void) setpt;
     return  DcSetInletCalFlowZero ( pneu_status );
}
static UI_ERR mSetInletCalState   ( void *status, INT32 setpt, U_INT8 unused_parm )
{
     (void) unused_parm;
        switch ( setpt )
        {
            case FACTORY:       return DcDeleteInletCalib ( pneu_status );
            case USER_ENABLED:  return DcTurnOnInletCalib ( pneu_status );
            case USER_DISABLED: return DcTurnOffInletCalib ( pneu_status );
        }

        return INVALID_PARAM;
}

UI_ERR NullFunc(void *which)
{
   (void) which;

   return OK;
}

UI_ERR DummyFunc ( void *which )
{
   (void) which;
   return OK;
}

UI_ERR LockPneuWkfile ( void *which )
{
   (void) which;
   LockResource ( &Inst_Status.Pneu.Resource_Lock );
   return OK;
}

UI_ERR IBLockPneuWkfile ( void *which )
{
   (void) which;

   if ( Inst_Status.Pneu.Installing_Method )
   {
       if ( TestForException ( BACK_INLET_TYPE  ) ||
            TestForException ( BACK_INLET_EPC   ) ||
            TestForException ( BACK_INLET_RANGE ))
       {
           /* hardware configuration mismatch */
           return NOT_ALLOWED;
       }
   }

   LockResource ( &Inst_Status.Pneu.Resource_Lock );
   return OK;
}

UI_ERR IFLockPneuWkfile ( void *which )
{
   (void) which;

   if ( Inst_Status.Pneu.Installing_Method )
   {
       if ( TestForException ( FRNT_INLET_TYPE  ) ||
            TestForException ( FRNT_INLET_EPC   ) ||
            TestForException ( FRNT_INLET_RANGE ))
       {
           /* hardware configuration mismatch */
           return NOT_ALLOWED;
       }
   }

   LockResource ( &Inst_Status.Pneu.Resource_Lock );
   return OK;
}

UI_ERR IFSPLockPneuWkfile ( void *whch )
{
   (void) whch;

   if ( GetInletType(pFRONT_INLET) == SS )
   {
      /* expected inlet is present */
      return IFLockPneuWkfile(whch);
   }
   return NOT_ALLOWED;
}

UI_ERR IBSPLockPneuWkfile ( void *whch )
{
   (void) whch;

   if (  GetInletType(pBACK_INLET) == SS )
   {
      /* expected inlet is present */
      return IBLockPneuWkfile(whch);
   }
   return NOT_ALLOWED;
}

UI_ERR IFGVLockPneuWkfile ( void *whch )
{
   (void) whch;

   if ( GetInletType(pFRONT_INLET) == CIS4 )
   {
      /* expected inlet is present */
      return IFLockPneuWkfile(whch);
   }
   return NOT_ALLOWED;
}

UI_ERR IBGVLockPneuWkfile ( void *whch )
{
   (void) whch;

   if (  GetInletType(pBACK_INLET) == CIS4 )
   {
      /* expected inlet is present */
      return IBLockPneuWkfile(whch);
   }
   return NOT_ALLOWED;
}

UI_ERR IFGPLockPneuWkfile ( void *whch )
{
   (void) whch;

   if ( GetInletType(pFRONT_INLET) == CIS3 )
   {
      /* expected inlet is present */
      return IFLockPneuWkfile(whch);
   }
   return NOT_ALLOWED;
}

UI_ERR IBGPLockPneuWkfile ( void *whch )
{
   (void) whch;

   if (  GetInletType(pBACK_INLET) == CIS3 )
   {
      /* expected inlet is present */
      return IBLockPneuWkfile(whch);
   }
   return NOT_ALLOWED;
}

UI_ERR IFVILockPneuWkfile ( void *whch )
{
   (void) whch;

   if ( GetInletType(pFRONT_INLET) == VOLATILES )
   {
      /* expected inlet is present */
      return IFLockPneuWkfile(whch);
   }
   return NOT_ALLOWED;
}

UI_ERR IBVILockPneuWkfile ( void *whch )
{
   (void) whch;

   if (  GetInletType(pBACK_INLET) == VOLATILES )
   {
      /* expected inlet is present */
      return IBLockPneuWkfile(whch);
   }
   return NOT_ALLOWED;
}


UI_ERR IFMSLockPneuWkfile ( void *whch )
{
   (void) whch;

   if ( GetInletType(pFRONT_INLET) == MANUAL_SS )
   {
      /* expected inlet is present */
      return IFLockPneuWkfile(whch);
   }
   return NOT_ALLOWED;
}

UI_ERR IBMSLockPneuWkfile ( void *whch )
{
   (void) whch;

   if (  GetInletType(pBACK_INLET) == MANUAL_SS )
   {
      /* expected inlet is present */
      return IBLockPneuWkfile(whch);
   }
   return NOT_ALLOWED;
}

UI_ERR IFCPLockPneuWkfile ( void *whch )
{
   (void) whch;

   if ( GetInletType(pFRONT_INLET) == COC )
   {
      /* expected inlet is present */
      return IFLockPneuWkfile(whch);
   }
   return NOT_ALLOWED;
}

UI_ERR IBCPLockPneuWkfile ( void *whch )
{
   (void) whch;

   if (  GetInletType(pBACK_INLET) == COC )
   {
      /* expected inlet is present */
      return IBLockPneuWkfile(whch);
   }
   return NOT_ALLOWED;
}

UI_ERR IFPPLockPneuWkfile ( void *whch )
{
   (void) whch;

   if ( GetInletType(pFRONT_INLET) == PP )
   {
      /* expected inlet is present */
      return IFLockPneuWkfile(whch);
   }
   return NOT_ALLOWED;
}

UI_ERR IBPPLockPneuWkfile ( void *whch )
{
   (void) whch;

   if (  GetInletType(pBACK_INLET) == PP )
   {
      /* expected inlet is present */
      return IBLockPneuWkfile(whch);
   }
   return NOT_ALLOWED;
}

UI_ERR IFDPLockPneuWkfile ( void *whch )
{
   (void) whch;

   if ( GetInletType(pFRONT_INLET) == SIMDIST )
   {
      /* expected inlet is present */
      return IFLockPneuWkfile(whch);
   }
   return NOT_ALLOWED;
}

UI_ERR IBDPLockPneuWkfile ( void *whch )
{
   (void) whch;

   if (  GetInletType(pBACK_INLET) == SIMDIST )
   {
      /* expected inlet is present */
      return IBLockPneuWkfile(whch);
   }
   return NOT_ALLOWED;
}

UI_ERR UnlockPneuWkfile ( void *which )
{
   (void) which;
   ReleaseResource ( &Inst_Status.Pneu.Resource_Lock );
   return OK;
}

void TurnInterruptsOFF ( void )
{
   INTERRUPTS_OFF;
}

void TurnInterruptsON ( void )
{
   INTERRUPTS_ON;
}

static UI_ERR mLetInletType (void *status, INT32 setpt, U_INT8 num)
{
        (void)num;
        gccw.InletType[(((pINLET_STATUS)pneu_status)->Position == FRNT_INLET) ? 0 : 1] = (INLET_TYPE)setpt;
        return OK;
}

static UI_ERR mLetZonePresence(void *status, INT32 setpt, U_INT8 num)
{
        (void)num;
    gccw.ZonePresence[(int)((((pINLET_STATUS)pneu_status)->Position == FRNT_INLET) ? INJA_ZONE : INJB_ZONE)] = (BIT8)setpt;
        return OK;
}

static UI_ERR mLetInletPSensorRange (void *status, INT32 setpt, U_INT8 num)
{
        (void)num;
        gccw.InletPSensorRange[(((pINLET_STATUS)pneu_status)->Position == FRNT_INLET) ? 0 : 1] = setpt;
        return OK;
}

static UI_ERR mLetInletPneuCfg (void *status, INT32 setpt, U_INT8 num)
{
        (void)num;
/*      gccw.IsInletEpc[(((pINLET_STATUS)pneu_status)->Position == FRNT_INLET) ? 0 : 1] = (TRUE_FALSE)setpt;    */
        gccw.IsInletEpc[(((pINLET_STATUS)pneu_status)->Position == FRNT_INLET) ? 0 : 1] = (TRUE_FALSE)(setpt & 1) ;
        gccw.InletVentState[(((pINLET_STATUS)pneu_status)->Position == FRNT_INLET) ? 0 : 1] = (TRUE_FALSE)((setpt & 2) >> 1) ;
        return OK;
}

static UI_ERR mLetInletGasType (void *status, INT32 setpt, U_INT8 num)
{
        (void)num;
        gccw.InletGasType[(((pINLET_STATUS)pneu_status)->Position == FRNT_INLET) ? 0 : 1] = (GAS_TYPE)setpt;
        return OK;
}

static UI_ERR mLetInletPresEquib (void *status, INT32 setpt, U_INT8 num)
{
        (void)num;
        gccw.InletPresEquib[(((pINLET_STATUS)pneu_status)->Position == FRNT_INLET) ? 0 : 1] = setpt;
        return OK;
}

static UI_ERR mLetInletFlowEquib (void *status, INT32 setpt, U_INT8 num)
{
        (void)num;
        gccw.InletFlowEquib[(((pINLET_STATUS)pneu_status)->Position == FRNT_INLET) ? 0 : 1] = setpt;
        return OK;
}

static INT32 mGetInletAutoCal   (void *status, U_INT8 num)
{
       (void) num;

        return GetInletAutoCal ( pneu_status );
}

static UI_ERR mSetInletAutoCal   (void *status, INT32 setpt, U_INT8 num)
{
       (void) num;

        return SetInletAutoCal ( (BIT8)(setpt != 0), pneu_status );
}
